home *** CD-ROM | disk | FTP | other *** search
- package views
- {
- import flash.accessibility.*;
- import flash.debugger.*;
- import flash.display.*;
- import flash.errors.*;
- import flash.events.*;
- import flash.external.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.media.*;
- import flash.net.*;
- import flash.printing.*;
- import flash.profiler.*;
- import flash.system.*;
- import flash.text.*;
- import flash.ui.*;
- import flash.utils.*;
- import flash.xml.*;
- import mx.binding.*;
- import mx.containers.Canvas;
- import mx.controls.Button;
- import mx.controls.Image;
- import mx.core.UIComponentDescriptor;
- import mx.core.mx_internal;
- import mx.events.FlexEvent;
- import mx.events.PropertyChangeEvent;
- import mx.styles.*;
-
- public class SpreadThumb extends Canvas
- {
- private static var _watcherSetupUtil:IWatcherSetupUtil;
-
- private var _bindings:Array;
-
- public var _bindingsByDestination:Object;
-
- [Bindable]
- private var _1792717999myFilters:Array;
-
- [Bindable]
- private var _686208864spreadThumbImg:Image;
-
- [Bindable]
- private var _3433103page:String;
-
- public var _bindingsBeginWithWord:Object;
-
- [Bindable]
- private var _859611628imageURL:String;
-
- [Bindable]
- private var _686197939spreadThumbTxt:Button;
-
- private var _watchers:Array;
-
- [Bindable]
- private var _187711434oldStyle:String = "spreadThumbNormal";
-
- [Bindable]
- private var _109780401style:String = "spreadThumbNormal";
-
- private var _documentDescriptor_:UIComponentDescriptor;
-
- public function SpreadThumb()
- {
- _documentDescriptor_ = new UIComponentDescriptor({
- "type":Canvas,
- "propertiesFactory":function():Object
- {
- return {"childDescriptors":[new UIComponentDescriptor({
- "type":Image,
- "id":"spreadThumbImg",
- "events":{"init":"__spreadThumbImg_init"},
- "stylesFactory":function():void
- {
- this.horizontalCenter = 0;
- },
- "propertiesFactory":function():Object
- {
- return {"y":0};
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"spreadThumbTxt",
- "stylesFactory":function():void
- {
- this.horizontalCenter = 0;
- },
- "propertiesFactory":function():Object
- {
- return {
- "buttonMode":false,
- "y":95,
- "height":20
- };
- }
- })]};
- }
- });
- _109780401style = "spreadThumbNormal";
- _187711434oldStyle = "spreadThumbNormal";
- super();
- mx_internal::_document = this;
- if(!this.styleDeclaration)
- {
- this.styleDeclaration = new CSSStyleDeclaration();
- }
- this.styleDeclaration.defaultFactory = function():void
- {
- this.horizontalCenter = 0;
- };
- this.addEventListener("creationComplete",___Canvas1_creationComplete);
- }
-
- public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
- {
- SpreadThumb._watcherSetupUtil = param1;
- }
-
- public function set imageURL(param1:String) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._859611628imageURL;
- if(_loc2_ !== param1)
- {
- this._859611628imageURL = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"imageURL",_loc2_,param1));
- }
- }
-
- [Bindable(event="propertyChange")]
- private function get myFilters() : Array
- {
- return this._1792717999myFilters;
- }
-
- [Bindable(event="propertyChange")]
- public function get spreadThumbImg() : Image
- {
- return this._686208864spreadThumbImg;
- }
-
- private function init() : void
- {
- var _loc1_:BevelFilter = null;
- var _loc2_:DropShadowFilter = null;
- _loc1_ = new BevelFilter(1,45,0,1,0,1,1,1,1);
- _loc2_ = new DropShadowFilter(2);
- myFilters = [_loc1_,_loc2_];
- }
-
- private function imageInit(param1:Event) : void
- {
- spreadThumbImg.width = spreadThumbImg.contentWidth;
- }
-
- public function set page(param1:String) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._3433103page;
- if(_loc2_ !== param1)
- {
- this._3433103page = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"page",_loc2_,param1));
- }
- }
-
- public function set spreadThumbImg(param1:Image) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._686208864spreadThumbImg;
- if(_loc2_ !== param1)
- {
- this._686208864spreadThumbImg = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"spreadThumbImg",_loc2_,param1));
- }
- }
-
- public function __spreadThumbImg_init(param1:Event) : void
- {
- imageInit(param1);
- }
-
- private function set myFilters(param1:Array) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1792717999myFilters;
- if(_loc2_ !== param1)
- {
- this._1792717999myFilters = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"myFilters",_loc2_,param1));
- }
- }
-
- [Bindable(event="propertyChange")]
- public function get style() : String
- {
- return this._109780401style;
- }
-
- private function _SpreadThumb_bindingsSetup() : void
- {
- var binding:Binding = null;
- if(!_bindings)
- {
- _bindings = [];
- }
- if(!_watchers)
- {
- _watchers = [];
- }
- binding = new Binding(this,function():Array
- {
- return myFilters;
- },function(param1:Array):void
- {
- spreadThumbImg.filters = param1;
- },"spreadThumbImg.filters");
- _bindings[0] = binding;
- binding = new Binding(this,function():Object
- {
- return "images/thumbs/" + imageURL;
- },function(param1:Object):void
- {
- spreadThumbImg.source = param1;
- },"spreadThumbImg.source");
- _bindings[1] = binding;
- binding = new Binding(this,function():Object
- {
- return style;
- },function(param1:Object):void
- {
- spreadThumbTxt.styleName = param1;
- },"spreadThumbTxt.styleName");
- _bindings[2] = binding;
- binding = new Binding(this,function():Array
- {
- return myFilters;
- },function(param1:Array):void
- {
- spreadThumbTxt.filters = param1;
- },"spreadThumbTxt.filters");
- _bindings[3] = binding;
- binding = new Binding(this,function():String
- {
- var _loc1_:* = undefined;
- var _loc2_:* = undefined;
- _loc1_ = page;
- return _loc1_ == undefined ? null : String(_loc1_);
- },function(param1:String):void
- {
- spreadThumbTxt.label = param1;
- },"spreadThumbTxt.label");
- _bindings[4] = binding;
- }
-
- [Bindable(event="propertyChange")]
- public function get imageURL() : String
- {
- return this._859611628imageURL;
- }
-
- public function ___Canvas1_creationComplete(param1:FlexEvent) : void
- {
- init();
- }
-
- public function set spreadThumbTxt(param1:Button) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._686197939spreadThumbTxt;
- if(_loc2_ !== param1)
- {
- this._686197939spreadThumbTxt = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"spreadThumbTxt",_loc2_,param1));
- }
- }
-
- [Bindable(event="propertyChange")]
- public function get page() : String
- {
- return this._3433103page;
- }
-
- public function set style(param1:String) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._109780401style;
- if(_loc2_ !== param1)
- {
- this._109780401style = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"style",_loc2_,param1));
- }
- }
-
- [Bindable(event="propertyChange")]
- public function get spreadThumbTxt() : Button
- {
- return this._686197939spreadThumbTxt;
- }
-
- override public function initialize() : void
- {
- var target:SpreadThumb = null;
- var watcherSetupUtilClass:Object = null;
- mx_internal::setDocumentDescriptor(_documentDescriptor_);
- _SpreadThumb_bindingsSetup();
- target = this;
- if(_watcherSetupUtil == null)
- {
- watcherSetupUtilClass = getDefinitionByName("_views_SpreadThumbWatcherSetupUtil");
- watcherSetupUtilClass["init"](null);
- }
- _watcherSetupUtil.setup(this,function(param1:String):*
- {
- return target[param1];
- },_bindings,_watchers);
- super.initialize();
- }
-
- private function _SpreadThumb_bindingExprs() : void
- {
- var _loc1_:* = undefined;
- _loc1_ = myFilters;
- _loc1_ = "images/thumbs/" + imageURL;
- _loc1_ = style;
- _loc1_ = myFilters;
- _loc1_ = page;
- }
-
- [Bindable(event="propertyChange")]
- public function get oldStyle() : String
- {
- return this._187711434oldStyle;
- }
-
- public function set oldStyle(param1:String) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._187711434oldStyle;
- if(_loc2_ !== param1)
- {
- this._187711434oldStyle = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"oldStyle",_loc2_,param1));
- }
- }
- }
- }
-
-